#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include<math.h>

int is_prime(int s)
{
    for (int i = 2; i <= sqrt(s); i++)
    {
        if (s % i == 0)
            return 0;
    }
    return 1;
}

int main()
{
    int n = 0;
    scanf("%d", &n);
    int count = 0;
    for (int i = 2; i <= n; i++)
    {
        if (is_prime(i))
        {
            printf("%d ", i);
        }
        else
        {
            count++;
        }
    }
    printf("\n%d", count);
    return 0;
}

#include <stdio.h>

int main()
{
    int n, m;
    scanf("%d %d", &n, &m);
    int max = 0;
    int max_line = 0;
    int max_row = 0;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {
            int tmp = 0;
            scanf("%d", &tmp);
            if (max < tmp)
            {
                max = tmp;
                max_line = i;
                max_row = j;
            }
        }
    }
    printf("%d %d", max_line + 1, max_row + 1);
    return 0;
}

#include <stdio.h>

int main()
{
    int n, m;
    scanf("%d %d", &n, &m);
    int arr[n][m];
    int flag = 1;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {
            scanf("%d", &arr[i][j]);
        }
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {
            int tmp = 0;
            scanf("%d", &tmp);
            if (tmp != arr[i][j])
                flag = 0;
        }
    }
    if (flag)
        printf("Yes");
    else
        printf("No");
    return 0;
}

#include <stdio.h>

int main()
{
    int n, m;
    scanf("%d %d", &n, &m);
    int sum = 0;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {
            int tmp = 0;
            scanf("%d", &tmp);
            if (tmp > 0)
                sum += tmp;
        }
    }
    printf("%d", sum);
    return 0;
}

#include <stdio.h>

int main()
{
    int n = 0;
    scanf("%d", &n);
    int arr[n][n];
    int time = n / 2 + n % 2;
    int count = 1;
    for (int i = 0; i < time; i++)
    {
        int line = i;
        int row = i;
        for (row = i; row < n - i; row++)
            arr[line][row] = count++;
        row--;
        for (line = i + 1; line < n - i; line++)
            arr[line][row] = count++;
        line--;
        for (row--; row >= i; row--)
            arr[line][row] = count++;
        row++;
        for (line--; line >= i + 1; line--)
            arr[line][row] = count++;
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            printf("%d ", arr[i][j]);
        }
        printf("\n");
    }
    return 0;
}